<extend name="public:base"/>

<block name="left">
    <div class="mark_bar cl">
        <a href="{:url('user/index/index')}" class="goback fl"><i class="iconfont">&#xe600;</i></a>
        <p>订单列表</p>
    </div>
</block>

<block name="main">

    <div class="container">
        <include file="invested:menu"/>
        <notempty name="list">
            <ul class="invest_log">
                <volist name="list" id="v">
                    <li>
                        <div class="title">
                            <a href="{:url('index/invest/detail',['id'=>$v['borrow_id']])}">{$v.borrow_name}</a>
                            <span class="small a999 fr"> {$v.create_time}



							</span>
                            <div class="cl"></div>
                        </div>

                        <div class="fl w40">
                            <p class="small">购买预付款(元)</p>
                            <p class="af90 large">{$v.prepay_money} </p>
                        </div>


                        <div class="fl w40">
                            <p class="small">购买剩余款(元)</p>
                            <p class="af90 large">{$v.remain_money} </p>
                        </div>

                        <div class="fl w20">
                            <p class="small">状态</p>
                            <p class="a999">{$v.status_name}</p>
                        </div>

                        <div class="cl"></div>
                        <if $v.audit_status eq 1>
                            <div class="date">
                                <span class="small a999"></span>
                                <span class="small">
											<a data-href="{:url('user/invested/ready')}" data-id="{$v['id']}"
                                               class="btn af60 readyOrder" onclick="readyOrder({$v['id']})" style="cursor: pointer;">确认下单</a>

								</span>
                                <div class="cl"></div>
                            </div>
                        </if>
                    </li>
                </volist>
            </ul>
            <div class="page">
                {$page|default=''}
            </div>
            <else/>
            <p class="empty">暂无购买记录！</p>
        </notempty>
    </div>

</block>

<block name="menu"></block>

<block name="js">
    <script type="text/javascript">

        function readyOrder(id) {
            //询问框
            layer.open({
                content: '是否确定购买？'
                ,btn: ['确定', '取消']
                ,yes: function(index){
                    $.post("{:url('user/invested/ready')}",{id:id},function (d) {
                        if(d.code == 1){
                            wjtips(d.msg);
                            setTimeout(function () {
                                window.location.href = "{:url('user/invested/receive')}";
                            },1500);
                            return false;
                        }else{
                            wjtips(d.msg);
                            return false;
                        }
                    });
                    layer.close(index);
                }
            });
        }
    </script>
</block>